import configparser

class Configuration():

    def __init__(self):
        config = configparser.ConfigParser()
        config.read('config.ini')
        # Data loader
        self.BATCH_SIZE_PER_CARD = int(config['Data loader']['BATCH_SIZE_PER_CARD'])
        self.TEST_BATCH_SIZE_PER_CARD = int(config['Data loader']['TEST_BATCH_SIZE_PER_CARD'])
        self.DATA_LOADER_NUM_WORKERS = int(config['Data loader']['DATA_LOADER_NUM_WORKERS'])
        self.TRAIN_PATH = config['Data loader']['TRAIN_PATH']
        self.TEST_PATH = config['Data loader']['TEST_PATH']
        self.MASK_COLOR = eval(config['Data loader']['MASK_COLOR'])
        self.MASK_COLOR = self.MASK_COLOR[::-1]

        # Train
        self.MODULE = config['Train']['MODULE']
        self.MODEL = config['Train']['MODEL']
        self.DATA_LOAD_MODULE = config['Train']['DATA_LOAD_MODULE']
        self.DATA_LOAD_MODEL = config['Train']['DATA_LOAD_MODEL']
        self.MAX_EPOCH = int(config['Train']['MAX_EPOCH'])
        self.TEST_INTERVAL = int(config['Train']['TEST_INTERVAL'])
        self.OPTIMIZER = config['Train']['OPTIMIZER']
        self.LR = float(config['Train']['LR'])
        self.LR_DECAY = float(config['Train']['LR_DECAY'])
        self.EVAL = eval(config['Train']['EVAL'])

        # Load and Save
        self.INIT_MODEL = config['Load and Save']['INIT_MODEL']
        self.SAVE_PATH = config['Load and Save']['SAVE_PATH']


cfg = Configuration()




